using System;
using System.Collections.Generic;
using System.Text;
using Pay.TO;

namespace Pay.Data {
    /// <summary>
    /// 订单表：mc_Order
    /// </summary>
    public partial class Order {
        public Order() {
            OrderItems = new List<OrderItem>();
            Profits = new List<Profit>();
        }
        /// <summary>
        /// 订单id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 单号
        /// </summary>
        public string OrderNo { get; set; }
        /// <summary>
        /// 支付信息
        /// </summary>
        public long PayId { get; set; }
        /// <summary>
        /// 商户id
        /// </summary>
        public long MerchantId { get; set; }
        /// <summary>
        /// 红砖兑换活动，获得红砖用户id
        /// </summary>
        public long? RedDrillReceiverId { get; set; }
        /// <summary>
        /// 支付商户id
        /// </summary>
        public long? BuyId { get; set; }
        /// <summary>
        /// 用户留言
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 订单时间
        /// </summary>
        public long OrderTime { get; set; }
        /// <summary>
        /// 订单完成时间
        /// </summary>
        public long? FinishTime { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public OrderStatus Status { get; set; }
        /// <summary>
        /// 优惠名称：折扣
        /// </summary>
        public string DiscountName { get; set; }
        /// <summary>
        /// 优惠金额：折扣金额
        /// </summary>
        public decimal DiscountAmount { get; set; }
        /// <summary>
        /// 运费
        /// </summary>
        public decimal Freight { get; set; }
        /// <summary>
        /// 税点
        /// </summary>
        public double? Tax { get; set; }

        /// <summary>
        /// 赠送积分
        /// </summary>
        /// <value>The points.</value>
        public int Points { get; set; }
        /// <summary>
        /// 三级分销总金额
        /// </summary>
        public decimal DisAmount { get; set; }
        /// <summary>
        /// 订单金额＝价格×数量＋运费
        /// </summary>
        public decimal OrderAmount { get; set; }
        /// <summary>
        /// 兑换积分
        /// </summary>
        public int Integral { get; set; }
        /// <summary>
        /// 红砖
        /// </summary>
        public decimal RedDrill { get; set; }
        /// <summary>
        /// 优惠金额：折扣金额
        /// </summary>
        public decimal IntegralDiscount { get; set; }
        /// <summary>
        /// 应付金额=订单金额-优惠-积分抵扣金额
        /// </summary>
        public decimal PayAmount { get; set; }
        /// <summary>
        /// 手续费=应付金额×商户的费率
        /// </summary>
        public decimal FeeAmount { get; set; }
        /// <summary>
        /// 分销商Id
        /// </summary>
        public long? DistributionId { get; set; }
        /// <summary>
        /// 来源店铺id
        /// </summary>
        public long? ShopId { get; set; }
        /// <summary>
        /// 商户费率
        /// </summary>
        public decimal Fee { get; set; }
        /// <summary>
        /// 卖家实收金额＝应付金额－手续费-分销＋积分抵扣金额
        /// </summary>
        public decimal Amount { get; set; }
        /// <summary>
        /// 分销与积分抵扣金额分配集合，如果是时代云商的有积分消费，此时金额中会有负数，是减使用着的冻结金额并加到卖家实收金额里，可空
        /// </summary>
        public string Binds { get; set; }
        /// <summary>
        /// 配送方式 1：物流 2：到店拿货，3：送货上门 4：无配送
        /// </summary>
        public int ShippingType { get; set; }
        /// <summary>
        /// 国内运费
        /// </summary>
        public decimal? PostFee { get; set; }
        /// <summary>
        /// 国外运费
        /// </summary>
        public decimal? SinoFee { get; set; }
        /// <summary>
        /// 订单来源类型：1海淘乐，2候鸟 6 集市 7实人认证
        /// </summary>
        public int? OrderType { get; set; }
        /// <summary>
        /// 订单推送状态
        /// </summary>
        public OrderPushStatus PushStatus { get; set; }
        /// <summary>
        /// 推送返回信息
        /// </summary>
        public string PushFailMsg { get; set; }
        /// <summary>
        /// 是否买家删除
        /// </summary>
        public bool IsBuyDel { get; set; }
        /// <summary>
        /// 是否卖家删除
        /// </summary>
        public bool IsSellDel { get; set; }
        /// <summary>
        /// 订单结算状态
        /// </summary>
        public OrderSettleStatus OrderSettle { get; set; }
        /// <summary>
        /// 商家（卖家）备注
        /// </summary>
        public string MerchantRemark { get; set; }
        /// <summary>
        /// 卖家
        /// </summary>
        public virtual Merchant Merchant { get; set; }
        /// <summary>
        /// 买家
        /// </summary>
        public virtual Merchant Buyer { get; set; }
        /// <summary>
        /// 订单配送
        /// </summary>
        public virtual Shipping Shipping { get; set; }
        /// <summary>
        /// 支付信息
        /// </summary>
        public virtual PayInfo PayInfo { get; set; }
        /// <summary>
        /// 分润表
        /// </summary>
        public virtual ICollection<Profit> Profits { get; set; }
        /// <summary>
        /// 订单明细表：mc_OrderItem集合
        /// </summary>
        public virtual ICollection<OrderItem> OrderItems { get; set; }
    }
    /// <summary>
    /// 订单退款/退货
    /// </summary>
    public partial class OrderRefund {
        /// <summary>
        /// 主键id
        /// </summary>
        public long Id { get; set; }
        /// <summary>
        /// 退货/退款单号
        /// </summary>
        public string OrderRefundNo { get; set; }
        /// <summary>
        /// 订单id
        /// </summary>
        public long OrderId { get; set; }
        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal Amount { get; set; }
        /// <summary>
        /// 退款/退货理由
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public OrderRefundStatus Status { get; set; }
        /// <summary>
        /// 操作类型
        /// </summary>
        public OrderRefundType Type { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public long MerchantId { get; set; }
        /// <summary>
        /// 处理时间
        /// </summary>
        public long HandleTime { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public long CreateTime { get; set; }
        public virtual Merchant Merchant { get; set; }
        public virtual Order Order { get; set; }
    }
}